;
; Hello world for MS-DOS
;
; Author: Renê de Souza Pinto
; Date..: Feb, 2009
;
; To compile: nasm hello.asm -f bin -o hello.com
;

[Bits 16]

ORG 0x100

section .text

	; Load string offset address
	; We do not need to load segment address
	; because when .COM files are loaded, all
	; the segment registers contain the same value
	lea ax,[message]
	mov dx,ax

	; Print message
	xor ax,ax     ; clear AX
	mov ah,0x09   ; 02h - Write string to standard  output
	int 0x21      ; Call DOS interrupt service


	; Exit program
	mov al,0x00   ; Exit code
	mov ah,0x4C   ; 4Ch - Exit program
	int 0x21      ; Call DOS interrupt service


section .data

	message db 'Hello World!$'

